<extend name="Index/index" />
<block name="nav1">
    <ul class="breadcrumb">
        <li>
            <i class="icon-home home-icon"></i>
            <a href="#">Admin</a>
        </li>
        <li class="active">友情链接管理</li>
    </ul><!-- .breadcrumb -->
</block>

<block name="nav2">
    <div class="page-content">
<div class="page-header">
    <h1>
        友情链接
        <small>
            <i class="icon-double-angle-right"></i>
            友情链接管理
        </small>
    </h1>
</div><!-- /.page-header -->
<form action="<{:U('Friends/search')}>" method="post">
    Name : <input type="text" name="name">
    <input type="submit" value="搜索">
</form>
<form action="<{:U('Friends/index')}>" method="post">
    <input type="submit" value="取消">
</form>
<div class="row">
    <div class="col-xs-12">
        <table class="table">
 		<tr>
 			<th>编号</th>
            <th>友情链接名</th>
 			<th>链接地址</th>
 			<th>状态</th>
 			<th>操作</th>
 		</tr>
 		<foreach name="list" item="v">
 			<tr class="delete">
 				<td><{$v.id}></td>
                <td><{$v.name}></td>
 				<td><{$v.url}></td>
                <td>
                	<if condition="$v.status eq '1'">
                        <a href="<{:U('status',array('id'=>$v['id'],'s'=>2))}>">显示</a>
                    <else/>
                        <a href="<{:U('status',array('id'=>$v['id'],'s'=>1))}>">隐藏</a>
                    </if>
                </td>
                <td>
                    <a href="<{:U('edit',array('id'=>$v['id']))}>" class="btn btn-danger">编辑</a>
                	<a  class="btn btn-danger del" id="delete">删除</a>
                    <a href="<{:U('Friends/del',array('id'=>$v['id']))}>" id="a" ></a>
                </td>
 			</tr>
 		</foreach>
 	</table>
    
    <div class="pages"><{$page}></div>
    </div>
</div>     

<block name="myjs">
<script src="__PUBLIC__/Js/jquery-2.1.4.min.js"></script>
    <script>

        $(".del").click(function(){
            console.log($("#delete"));

            var url=$(this).next().attr('href');
            var th = $(this);
            var del = $(this).parents('.delete');
            console.log(del);
            $.ajax({
                type:'get',
                url:url,
                success:function(data){
                     alert('删除成功');
                    del.hide();
                },
            })
        }) 
    </script>
</block>
</block>




